try { a = Double.parseDouble(b); } catch (NumberFormatException e) { //the parseDouble failed and you need to handle it here }
double d = Double.parseDouble(aString);
String str="122.202"; double dnum = Double.parseDouble(str);